import Qs from 'qs'

export const getCategoryInfo = (vm) => {
  let data = Qs.stringify({
    model: vm.itemName
  })
  console.log(data,vm.itemName)
  vm.$axios.post('/commodity/select/model', data)
    .then((res) => {
      vm.categoryList = res.data.data
    })
}

export const getCategoryDetail = (vm) => {
  let data = Qs.stringify({
    id: vm.categoryId
  })
  vm.$axios.post('/commodity/select/id', data)
    .then((res) => {
      vm.category = res.data.data
      console.log(res)
    })
}
